package com.lefevre.cms.bean.question;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 问题标签中间表
 *
 * @author Lefevre
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("question_tag_association")
@Entity
@Table(name = "question_tag_association", indexes = {@Index(name = "question_tag_association_1_idx", columnList = "questionId"), @Index(name = "questionTagAssociation_2_idx", columnList = "questionTagId")})
public class QuestionTagAssociation implements Serializable {
    private static final long serialVersionUID = 7948414425873700267L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.INPUT)
    private Long id;

    /**
     * 用户名称
     **/
    @Column(length = 30)
    @TableField("userName")
    private String userName;

    /**
     * 问题Id
     **/
    @TableField("questionId")
    private Long questionId;

    /**
     * 问题标签Id
     **/
    @TableField("questionTagId")
    private Long questionTagId;

    /**
     * 问题标签名称
     **/
    @Transient
    @TableField(exist = false)
    private String questionTagName;

}

